import axios from 'axios';
export let ERROR_OK = 0
// 使用axios请求数据的公共js文件-----暂时未用

//推荐页接口
export function getRecomment(callback){
	axios('/vkey/cgi-bin/musicu.fcg',{
		params:{
			"cgiKey": "GetHomePage",
			"_": "1578908583179",
			"data": {"comm":{"g_tk":5381,"uin":"","format":"json","inCharset":"utf-8","outCharset":"utf-8","notice":0,"platform":"h5","needNewCode":1},"MusicHallHomePage":{"module":"music.musicHall.MusicHallPlatform","method":"MobileWebHome","param":{"ShelfId":[101,102,161]}},"hotkey":{"module":"tencent_musicsoso_hotkey.HotkeyService","method":"GetHotkeyForQQMusicMobile","param":{"remoteplace":"txt.miniapp.wxada7aab80ba27074","searchid":"1559616839293"}}}
		}
	}).then(data=>{
		callback(data)
	}).catch(error=>{
		callback(error)
	})
}

//排行榜接口
export function getRanking(callback){
	let date = new Date().getTime()
	axios('/api/v8/fcg-bin/fcg_myqq_toplist.fcg',{
		params:{
			g_tk: 5381,
			uin: 0,
			format: 'json',
			inCharset: 'utf-8',
			outCharset: 'utf-8',
			notice: 0,
			platform: 'h5',
			needNewCode: 1,
			_: date,
		}
	}).then(data=>{
		callback(data)
	}).catch(error=>{
		callback(error)
	})
}

//歌手排行
